package com.ldc.framework.adapter

import com.ldc.commonlibs.listener.OnRowListener
import com.ldc.commonres.common.BaseRvAdapter
import com.ldc.commonres.common.BaseRvViewHolder
import com.ldc.framework.R
import com.ldc.framework.model.ProjectClassModel

class ProjectAdapter :
    BaseRvAdapter<ProjectClassModel.ProjectClassModelItem>(R.layout.framework_layout_view_item_project) {
    private var onRowListener: OnRowListener<ProjectClassModel.ProjectClassModelItem>? = null

    fun addOnRowListener(onRowListener: OnRowListener<ProjectClassModel.ProjectClassModelItem>?) {
        this.onRowListener = onRowListener
    }

    override fun convertTo(
        holder: BaseRvViewHolder,
        data: ProjectClassModel.ProjectClassModelItem,
        position: Int
    ) {
        holder.setText(R.id.tv_name, data.name)
        holder.addOnRowListener(holder.itemView, data, onRowListener)
    }
}